function graphTrace(options) {
	

    var _defaults = {
        srcEle: this,
        pid: $(this).attr('pid'),
	    pdid: $(this).attr('pdid'),
	    url:'',
	    imageUrl:'',
	    traceUrl:''
    };
    var opts = $.extend(true, _defaults, options);

    
	/*
	用官方开发的Diagram-Viewer跟踪
	 */


    // 获取图片资源
    var imageUrl =opts.imageUrl;
    
    $.ajax({
    	
    	 url:opts.traceUrl,
    	 'dataType':'json',
    	 type:'get',
    	 async:'false',
    	 success:function(infos){

    	        var positionHtml = "";

    	        // 生成图片
    	        var varsArray = new Array();
    	        $.each(infos, function(i, v) {
    	            var $positionDiv = $('<div/>', {
    	                'class': 'activity-attr'
    	            }).css({
    	                position: 'absolute',
    	                left: (v.x - 1),
    	                top: (v.y - 1),
    	                width: (v.width - 2),
    	                height: (v.height - 2),
    	                backgroundColor: '#fff',
    	                opacity: 0,
    	                zIndex: $.fn.qtip.zindex - 1
    	            });
    	            
    	            //节点名称
    	            
    	            var nodeNameTxt='';
    	            var  nodeNanme=v.vars;
    	            
    	            $.each(nodeNanme, function(varKey, varValue) {
    	            	
    	            	if(varKey=='节点名称'){
    	            		
    	            		nodeNameTxt=varValue;
    	            		return ;
    	            	}
    	            	
	                    
	                   
	                });
    	            
    	            var le=v.x;
    	            le=Number(le)+20;
    	            var t=v.y;
    	            t=Number(t)+20;
    	            
    	            var $nameDiv = $('<div/>', {
    	                'class': 'activity-name'
    	            }).css({
    	                position: 'absolute',
    	                left: (le-1),
    	                top: (t-1),
    	                width: (v.width - 10),
    	                height: (v.height -10),
    	             
    	                zIndex: $.fn.qtip.zindex - 2
    	            }).text(nodeNameTxt);

    	            // 节点边框
    	            var $border = $('<div/>', {
    	                'class': 'activity-attr-border'
    	            }).css({
    	                position: 'absolute',
    	                left: (v.x - 1),
    	                top: (v.y - 1),
    	                width: (v.width - 4),
    	                height: (v.height - 3),
    	                zIndex: $.fn.qtip.zindex - 2
    	            });

    	            if (v.currentActiviti) {
    	                $border.addClass('ui-corner-all-12').css({
    	                    border: '3px solid red'
    	                });
    	            }
    	            positionHtml += $positionDiv.outerHTML()+$nameDiv.outerHTML() + $border.outerHTML();
    	            varsArray[varsArray.length] = v.vars;
    	        });
    	       

    	        if ($('#workflowTraceDialog').length == 0) {
    	        	
    	        	var mhtml="<div style='width: 100%;height: 100%;overflow:scroll;background-color:#fff;position: relative;' id='workflowTraceDialog'> <div ><img src='" + imageUrl + "' style='position:absolute; left:0px; top:0px;' />" +
    	                      "<div id='processImageBorder'>" + positionHtml + "</div>" + "</div> </div>";
    	        	
    	        	$("#shi_process").html(mhtml);
    	        } else {
    	            $('#workflowTraceDialog img').attr('src', imageUrl);
    	            $('#workflowTraceDialog #processImageBorder').html(positionHtml);
    	        }

    	        // 设置每个节点的data
    	        $('#workflowTraceDialog .activity-attr').each(function(i, v) {
    	            $(this).data('vars', varsArray[i]);
    	        });
    	        
    	        // 此处用于显示每个节点的信息，如果不需要可以删除
    	        $('.activity-attr').qtip({
    	            content: function() {
    	                var vars = $(this).data('vars');
    	                var tipContent = "<table class='need-border' id='need-border'>";
    	                $.each(vars, function(varKey, varValue) {
    	                    
    	                	tipContent += "<tr><td class='label'>" + varKey + "</td><td>" + varValue + "</td></tr>";
    	                   
    	                });
    	                tipContent += "</table>";
    	                return tipContent;
    	            },
    	            position: {
    	                at: 'bottom left',
    	                adjust: {
    	                    x: 3
    	                }
    	            },
    	        });

    		 
    	 },
    	 error:function(){
    		 
    		 console.log("数据请求失败");
    	 }
    	
    	
    	
    	
    });
 
}
